﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var acmessagelmain_js_recontent_empty = "_{acmessagelmain_js_recontent_empty}";
	var acmessagelmain_js_size_empty = "_{acmessagelmain_js_size_empty}";
	var acmessagelmain_js_edit_ok = "_{acmessagelmain_js_edit_ok}";
	var acmessagelmain_js_edit_no = "_{acmessagelmain_js_edit_no}";
	var iframename = "#{iframename}";
	iframename = iframename=='' ? "jerichotabiframe_0" : iframename;
	var addtype = "#{type}";
	$(document).ready(function(){
	    var h = '#{iframeheightwindow}';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: false
		}
		$('#infosave').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		if (parent.document.getElementById('centerleft')){
			parent.scrolclear();
		}
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['recontent']==''){
			document.infosave.recontent.focus();
			alert(acmessagelmain_js_recontent_empty);
			return false;
		}
		parent.windowsdig('Loading','iframe:#{load}','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			if(parent.frames[iframename].document.getElementById("selectform")){
				parent.frames[iframename].refresh('selectform','selectall','check_all');
			}
			alert(acmessagelmain_js_edit_ok);
		}else{
			alert(acmessagelmain_js_edit_no+"("+options+")");
		}
		if (parent.document.getElementById('centerleft')){
			parent.scrolopen();
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<%var read = v.data("read") as Document_Message; %>
<form name="infosave" id="infosave" method="post" action="#{ActionLink}">
<input type="hidden" name="inputclass" value="#{type}" />
<input type="hidden" name="lng" id="lng" value="#{lng}" />
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="colorgorningage">_{acmessagelmain_edit_mess}</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_add_name}</td>
						<td class="trtitle02">#{read.name}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_add_content}</td>
						<td class="trtitle02">#{read.content}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_add_recontent}</td>
						<td class="trtitle02"><textarea name="recontent" cols="50" rows="5" class="smallInput" style="width:98%;height:100px;">#{read.recontent}</textarea></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">_{acmessagelmain_edit_mess_1}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{article_doc_add_linkdid}</td>
						<td class="trtitle02">#{articelread.title} ID=#{articelread.Id}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_text_ip}</td>
						<td class="trtitle02">#{read.ipadd}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_text_name}</td>
						<td class="trtitle02">#{read.name}</td>
					</tr>
                    <%PowerGroup modelpowergroup = v.data("powergroup") as PowerGroup; %>
                    <%var bllPowerGroupService = new PowerGroupService(); %>
					<%if(read.userid>0){ %>
                    <%var user = wojilu.Members.Users.Domain.User.findById(read.userid); %>
					<tr class="trstyle2">
						<td class="trtitle01">_{enquirymain_add_userid}</td>
						<td class="trtitle02"><%=user.Name %>  <%if (bllPowerGroupService.powercheck("member", "memberedit", modelpowergroup)) { %><a class="tabclicklink" onclick="javascript:parent.onbotton('_{viewmember_botton}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.MemberController().MemberEdit,read.Id) %>?type=edit&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),true,'memberedit<%=user.Id %>',self.frameElement.getAttribute('name'));" id="memberedit<%=user.Id %>" href="#body" title="<%=user.Name %>" hidefocus="true">_{viewmember_botton}</a> <%} %></td>
					</tr>
					<%} %>
                    <%if (read.adminid > 0) { %>
					<tr class="trstyle2">
						<td class="trtitle01">_{payreceiptlist_add_username}</td>
						<td class="trtitle02"><%=wojilu.Members.Users.Domain.User.findById(read.adminid).Name %></td>
					</tr>
					<%} %>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_text_addtime}</td>
						<td class="trtitle02">#{read.addtime}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_text_retime}</td>
						<td class="trtitle02">
							<%if(!read.retime.IsNull()){ %><%=read.retime %><%}else{ %><span class="strong colorgreg">_{formmessmain_isreply_botton2}</span><%} %>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_text_support}</td>
						<td class="trtitle02">#{read.support}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{acmessagelmain_text_oppose}</td>
						<td class="trtitle02">#{read.oppose}</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table width="100%">
			<tr>
				<td id="right"><input type="submit" id="docaddsubmitbotton" name="Submit" value="_{botton_remess}" class="buttonface" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="_{botton_remess_reset}" class="buttonface" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>